package com.smartum.mpr.client.view;

import com.smartgwt.client.widgets.tile.TileRecord;

import java.sql.Timestamp;

/**
 */
public class ImageRecord extends TileRecord {

    public ImageRecord(Long id, String name, String picture, String littlePicture, Long timestamp) {
        setId(id);
        setName(name);
        setPicture(picture);
        setTimestamp(timestamp);
        setLittlePicture(littlePicture);
    }

    public void setTimestamp(Long timestamp) {
        setAttribute("timestamp", timestamp);
    }

    public Long getTimestamp() {
        if (getAttribute("timestamp") == null) {
            return new Timestamp(0).getTime();
        } else {
            return new Long(getAttribute("timestamp"));
        }
    }

    public void setName(String name) {
        setAttribute("name", name);
    }

    public String getName() {
        return getAttribute("name");
    }

    public void setPicture(String picture) {
        setAttribute("picture", picture);
    }

    public String getPicture() {
        return getAttribute("picture");
    }

    public void setId(Long id) {
        setAttribute("id", id);
    }

    public Long getId() {
        return getAttributeAsLong("id");
    }

    public void setLittlePicture(String littlePicture) {
        setAttribute("littlePicture", littlePicture);
    }
}